{include template('header','common')}
<div style=" background:url({THEME_STYLE_PATH}style/images/bgr.gif)"></div>
<?php
	$userinfo = getuserinfo();
	$captcha_info  = get_captcha_info($id);	
	$capcahe_list  = get_captcha_list($id, $userinfo['id']);
	$capcahe_count = get_captcha_count($id, $userinfo['userid']);
?>

	<div id="Mainbox">

<link href="{THEME_STYLE_PATH}style/css/dama.css" type="text/css" rel="stylesheet" />
		<!--插入侧边栏-->
		{include template('sidebar_login','common')}
		<!--插入侧边栏-->
		<!--顶端公告-->
		{include template('top_advance','common')}
		<!--左侧-->
		
		<div class="Inside_left">
			<!--打码-->
			<div class="Tycontent">
				<!--选项卡-->
				<div class="Dmin_title">{$title}</div>
				<!--选项卡-->
				<!--打码基本信息-->
				<div class="Dmin_about">
					<ul>
						<li class="a1">码值：<span class="ofe">{$price}</span><img src="{THEME_STYLE_PATH}style/images/ub.gif"></li>
						<li class="a2">是否换IP：{if $is_changeip == 0}不换IP{else}换IP{/if}</li>
						<li class="a3">任务状态：{$dama_type}</li>
						<li class="a1">数据结算周期：{$period}天</li>
						<li class="a2">最近更新时间：<?php echo dgmdate($captcha_info['updatetime']) ;?></li>
						<li class="a3"></li>
						<li class="a4">
						{if $soft_download}
							<a href="{$soft_download}" target="_blank" class="Dm_dl"></a>&nbsp;&nbsp;&nbsp;&nbsp;
						{/if}
							<a href="javascript:void(0);" onclick="hitDraw('{$id}')" class="Dm_gh"></a>
						</li>
					</ul>
					{if $thumb}
					<div class="Dmin_ad"><img src="{$thumb}" height="100" width="180"></div>
					{/if}
					<div class="clear"></div>					
					{if !$userinfo}
					<div class="Dmin_unlogin">				
					对不起，你尚未登陆，如果你已注册，请
					<a href="/login/{__SELF__}" class="g46">点此登陆</a>。&nbsp;&nbsp;&nbsp;还没有帐号？点击这里
					<a href="/register/" class="sreglink">立即注册</a>
					</div>
					{/if}
				</div>
				<!--打码基本信息-->
				<!--打码收益表-->
				<div class="tyzt_title"><span class="g2f">我的{$title}总收益</span></div>
				<table class="Dmsy" border="0" cellpadding="0" cellspacing="1" bgcolor="#efefef" width="674">
				  	<tbody>
					  	<tr>
							<td class="a1 title" bgcolor="#ffffff">打码工号</td>
							<td class="a2 title" bgcolor="#ffffff">密码</td>
							<td class="a3 title" bgcolor="#ffffff">码值</td>
							<td class="a4 title" bgcolor="#ffffff">本期积分</td>
							<td class="a5 title" bgcolor="#ffffff">累计积分</td>
							<td class="a6 title" bgcolor="#ffffff">本期{type_change()}币</td>
							<td class="a7 title" bgcolor="#ffffff">总计{type_change()}币</td>
							<td class="a8 title" bgcolor="#ffffff">最新更新时间</td>
					  	</tr>
					  	{if $captcha_info}
					  	<tr>
							<td class="a1" bgcolor="#ffffff">{$captcha_info[name]}</td>
							<td class="a2" bgcolor="#ffffff">123456</td>
							<td class="a3" bgcolor="#ffffff"><span class="ofe">{$price}</span><img src="{THEME_STYLE_PATH}style/images/ub.gif"></td>
							<td class="a4" bgcolor="#ffffff">{$capcahe_count[yard_num]}</td>
							<td class="a5" bgcolor="#ffffff">{$capcahe_count[all_yard_num]}</td>
							<td class="a6" bgcolor="#ffffff"><span class="ofe">{$capcahe_count[yard_u_coin]}</span><img src="{THEME_STYLE_PATH}style/images/ub.gif"></td>
							<td class="a7" bgcolor="#ffffff"><span class="ofe">{$capcahe_count[all_yard_u_coin]}</span><img src="{THEME_STYLE_PATH}style/images/ub.gif"></td>
							<td class="a8" bgcolor="#ffffff">{dgmdate($captcha_info[updatetime], 'Y-m-d')}</td>
						</tr>
						{/if}
				  	</tbody>
			 	</table>
				<!--打码收益表-->
				
				<!--领取工资-->
				<div class="tyzt_title"><span class="g2f">领取{$title}每日工资</span><a href="#" class="unty_btn" target="_blank">新手打码教程</a>
				</div>
				<table class="Dmgz" border="0" cellpadding="0" cellspacing="1" bgcolor="#efefef" width="674">
				  	<tbody>
					  	<tr>
							<td class="a1 title" bgcolor="#ffffff">打码日期</td>
							<td class="a2 title" bgcolor="#ffffff">当日积分</td>
							<td class="a3 title" bgcolor="#ffffff">当日工资</td>
							<td class="a4 title" bgcolor="#ffffff">领取工资</td>
					  	</tr>

					  	{loop $capcahe_list $t $r}
					  	<tr {if $n > 7}style="display:none;"{/if}>
							<td class="a1 title" style="font-weight:normal" bgcolor="#ffffff">{dgmdate($t, 'Y-m-d')}</td>
							<td class="a2" bgcolor="#ffffff">
							{if $r[yard_num]}
							<span class="ofe">{$r[yard_num]}</span><img src="{THEME_STYLE_PATH}style/images/ub.gif">
							{else}
							<span class="da3">-</span>
							{/if}
							</td>
							<td class="a3" bgcolor="#ffffff">
							{if $r[yard_u_coin]}
							<span class="ofe">{$r[yard_u_coin]}</span><img src="{THEME_STYLE_PATH}style/images/ub.gif">
							{else}
							<span class="da3">-</span>
							{/if}
							</td>
							<td class="a4" bgcolor="#ffffff">
							{if empty($r)}
								<span class="da3">数据暂未更新</span>
							{else}
								{if ($r['status'] == 1)}
								<span class="da3">已领取</span>
								{else}
								<a href="javascript:void(0);" onclick="awardCaptcha({$r[id]})"></a>
								{/if}
							{/if}
							</td>
					  	</tr>
					  	{/loop}					  	
					  	<tr id="showMore" onclick="$('.Dmgz tr').show();$('#showMore').hide();">
					  		<td colspan="4" style="cursor: pointer;" align="center">点击查看更多</td>
					  	</tr>
				 	</tbody>
			 	</table>
			 	<div class="gztips">注：每日该打码任务工资在该页面领取，每日工资最长保留14天，请按时领取。如有疑问请联系客服。
			 	</div>
				<!--领取工资-->
				
				<!--项目介绍-->
				<div class="tyzt_title"><span class="g2f">项目介绍</span></div>
				<div class="Dmjbjs">{$content}</div>
				<!--项目介绍-->
				<!--基本常识-->
				<div class="tyzt_title"><span class="g2f">基本常识</span></div>
				<div class="Dmjbjs">
				<p class="a1">码值：每一码的价格(TT除外)，货币为{type_change()}币<br>打码奖励=有效码数 * 码值<br>打码奖励发放时间为清零后的48小时内(LA除外)<br>
<strong>所有项目7天无业绩一律回收工号，长久不打的项目在开工前先在本页查看工号是否还显示，如不显示请重新领号</strong></p>
				
				</div>
				<!--基本常识-->
			</div>				
		</div>
		<!--左侧-->
		<!--右侧-->
		{include template('dama_right','common')}
		<!--右侧-->
		<div class="clear"></div>
	</div>
	<!--主体-->
{include template('footer','common')}
<!-- 领取工号 -->
<script type="text/javascript">
var isSubmit = false;
function hitDraw(id){
	if(isSubmit){
		return false;
	}
	isSubmit = true;
	if(id<1){
		alert('参数丢失！');
		isSubmit = false;
		return isSubmit;
	}
	$.ajax({
		type: "POST",
		url: "{U('Document/YardFactory/chk_yard')}",
		async: false,
		data : {"yard_id":id},
		dataType: "json",		
		success: function(strJson){
			if(strJson.status==0){
				alert(strJson.info);
				isSubmit = false;
				location.href=strJson.url;
			}else{
				alert(strJson.info);
				location.reload();
				return isSubmit;
			}
		}
	})
}

/* 领取打码奖励 */
function awardCaptcha(logid) {
	$.ajax({
		type : "POST",
		url : "{U('Document/YardFactory/do_yard')}",
		data : {"logid" : logid},
		dataType : "json",
		success:function(strJson) {
			if(strJson.status == 1) {
				alert(strJson.info);
				location.reload();
				return true;
			} else {
				alert(strJson.info);
				return false;
			}
		}
	});
}		
</script>
</body>
</html>